<?php
/**
 * The following variables are available in this template:
 * - $this: the CrudCode object
 */
?>
<?php echo "<?php\n"; ?>
/* @var $this <?php echo $this->getControllerClass(); ?> */
/* @var $model <?php echo $this->getModelClass(); ?> */

<?php
$label=$this->pluralize($this->class2name($this->modelClass));
echo "\$this->breadcrumbs=array(
  '$label'=>array('index'),
  'Manage',
);\n";
?>
?>

<section class="panel">
    <header class="panel-heading">
        <i class="icon-group"></i> <?php echo $this->pluralize($this->class2name($this->modelClass)); ?>列表
        <div class="pull-right ">
            <?php echo "<?php echo CHtml::link('<i class=\'icon-plus\'></i> 添加', array('create'), array('class' => 'btn btn-info'));?>"; ?>
        </div>
        <div class="clearfix"></div>
    </header>
</section>

<!--page start-->
<div class="adv-table">
<?php echo "<?php"; ?> $this->widget('ext.EcloudWidget.EcloudWidget', array(
  'id'=>'<?php echo $this->class2id($this->modelClass); ?>-grid',
    'dataProvider' => $model->search(),
//    'filter' => $model,
    'itemsCssClass' => 'display table table-bordered',
    'enableSorting' => false,
    'template' => "{items}{summary}{pager}",
    'summaryText' => '每页显示50条,共{count}条',
    'emptyText' => '没有数据',
    'enableHistory' => true,
    'pager' => array(
        'class' => 'CLinkPager',
        'header' => '',
        'nextPageLabel' => '下一页',
        'prevPageLabel' => '上一页',
        'firstPageLabel' => '首页',
        'lastPageLabel' => '尾页',
    ),
  'columns'=>array(
<?php
$count=0;
foreach($this->tableSchema->columns as $column)
{
  if(++$count==7)
    echo "\t\t/*\n";
  echo "\t\t'".$column->name."',\n";
}
if($count>=7)
  echo "\t\t*/\n";
?>
    array(
      'class'=>'CButtonColumn',
      'header' => '操作', //指明头信息
      'template'=>"{view} {update} {delete}", 
      'deleteConfirmation'=>"js:'是否要删除?'",  //修改删除提示语句
    ),
  ),
)); ?>


</div>
<!--page end-->
